package com.lucfzy.resp;

import lombok.Data;

@Data
public class Response<T> {
    private int code;
    private T result;
    private String msg;

    public Response(int code, T result, String msg) {
        this.code = code;
        this.result = result;
        this.msg = msg;
    }

    public static Response ok() {
        return new Response(200,null,"success");
    }

    public static Response error() {
        return new Response(500,null,"failed");
    }

    public static Response error(String errorMsg) {
        return new Response(500,null,errorMsg);
    }
}
